/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package muestraTecnologica;

import javax.swing.JOptionPane;

/**
 *
 * @author David Cuellar
 */
public class Main {
    
    protected static String idAlumno;
    protected static String claveAdmin;
    protected static String host;
    protected static boolean val;
    protected static int conexion;
    protected static byte count;
    
    public static void main(String[] args)
    {
        idAlumno = "";
        val = false;
        conexion = 0;
        count = 0;
        
        claveAdmin = JOptionPane.showInputDialog(null, "Ingresa la Clave para Administracion : ");
        
        while(conexion == 0){
            
            host = JOptionPane.showInputDialog(null, "Ingresa la Direccion IP del Servidor de Base de Datos : ");
            DataBase dbase = new DataBase();
            val = dbase.testConect();
            dbase.cerrarConexion();

            if(val){
                LoginFrame ini = new LoginFrame();
                ini.setVisible(true);
                ini.revalidate();
                ini.repaint();
                conexion = 1;
            }
            else{
                conexion = 0;
            }
            
            count += 1;
            
            if(count > 2){
                
                System.exit(0);
            }
        
        }
    }
}
